﻿using System;

namespace DuckFlyWithInterface
{
    interface IFlyBehavior
    {
        public void Fly();
    }

    interface IQuackBehavior
    {
        public void Quack();
    }

    interface ISwimBehavior
    {
        public void Swim();
    }

    public class FlyWithWings : IFlyBehavior
    {
        public void Fly()
        {
            Console.WriteLine("用翅膀飞！");
        }
    }

    public class FlyWithNoWay : IFlyBehavior
    {
        public void Fly()
        {
            Console.WriteLine("不能飞！");
        }
    }

    public class FlyWithRocket : IFlyBehavior
    {
        public void Fly()
        {
            Console.WriteLine("乘坐火箭飞！");
        }
    }

    public class NormalQuack : IQuackBehavior
    {
        public void Quack()
        {
            Console.WriteLine("鸭子都会叫！");
        }
    }

    public class MuteQuack : IQuackBehavior
    {
        public void Quack()
        {
            Console.WriteLine("这只鸭子不会叫！");
        }
    }

    public class NormalSwim : ISwimBehavior
    {
        public void Swim()
        {
            Console.WriteLine("鸭子会游泳！");
        }
    }

    public class CannotSwim : ISwimBehavior
    {
        public void Swim()
        {
            Console.WriteLine("这只鸭子不会游泳！");
        }
    }
}